function save() {
	var editState = 0;
	if ("UPDATE" == method) {
		editState = 3;
	} else if ('INSERT' == method) {
		editState = 1;
	}
	var param = RS.getFormData('editForm');
	$.ajax({
			url : RS.webPath + "/admin/rsMenu/edit",
			type : 'post',
			data : 'editState=' + editState + '&method=' + method + '&__paramSet__=' + param,
			dataType : 'json',
			success : function(data) {
				if (data.status == 1) {
					parent.layer.alert('提交成功', function(index) {
						parent.layer.close(index);
						parent.location.reload();
					});
				} else {
					parent.layer.alert('提交失败');
				}
			}
	});
}

$(function() {
	if ("UPDATE" == method) {
		RS.loadForm('editForm', retInfo);
	}
	layui.form.render();
});

var selectIndex;
function selectParent() {
	selectIndex = parent.layer.open({
			type : 2,
			area : [ '300px', '450px' ],
			fixed : false, // 不固定
			maxmin : true,
			content : 'selectMenu',
	});
}

function getParent(pid,name){
	$('#parentId').val(pid);
	$('#parentName').val(name);
	parent.layer.close(selectIndex);
}
